"""
定义Person类
(1)里面有name , age属性
(2)提供compare_to比较方法,用于判断是否和另外一个人相等
(3)名字和年龄都一样,就返回True,否则就返回False
"""
"""
思路分析:
(1)类名:Person
(2)属性:name , age
(3)方法:compare_to(self , other)
(4)功能：名字和年龄一样,就返回True,否则就返回False
"""
class Personal:
    name = None
    age = None

    #比较方法 other 代表的是其他对象
    def compare_to(self , other):
        return self.name == other.name and self.age == other.age

#定义对象1
personal1 = Personal()
#给属性赋值
personal1.name = "樊振东"
personal1.age = 27

#定义对象2
personal2 = Personal()
personal2.name = "樊振东"
personal2.age = 27
is_true = personal1.compare_to(personal2)
print(is_true)